import React, { Component } from "react";
import { Table, Button } from "antd"
export default class Tab extends Component {
    columns = [
        {
            title: 'Name',
            dataIndex: 'name',
            render: (text) => <a>{text}</a>,
        },
        {
            title: 'Age',
            dataIndex: 'age',
        },
        {
            title: 'Address',
            dataIndex: 'address',
        },
        {
            title: '操作',
            key: "btn",
            render: (a) => (
                <span>
                    <Button type='danger' onClick={() => { this.del(a) }}>删除</Button>
                    <Button type='primary' onClick={() => { this.edit(a) }}>修改</Button>
                </span>
            ),
        },
    ];
    del = n => {
        this.props.delList(n)
    }
    edit = n => {
        this.props.openDia()
        this.props.updateList(n)
        this.props.isUpdata1(1)
    }
    render() {
        let { list } = this.props
        return (
            <div>
                <Table
                    dataSource={list}
                    columns={this.columns}
                ></Table>
            </div>
        )
    }
}